package com.homework.week3;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;

public class OkHttpClint {

    public static String requestURL(String url) throws IOException {
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder().get().url(url).build();
        Response response =client.newCall(request).execute();
        String data = response.body().string();
        System.out.print("response:");
        System.out.println(data);
        return data;
    }

}
